package com.meiyue.bean.entity;

import javax.persistence.*;

/**
 * MeiyueJavaProject
 * com.meiyue.bean.entity
 * Created by Chris Chen
 * 2017/9/14
 * Explain:
 */
@Entity
@Table(name = "test_order_journeys", schema = "test_yuedao", catalog = "")
public class TestOrderJourneysEntity {
    private int id;
    private int orderId;
    private int distance;
    private int orderPriceId;
    private String startName;
    private Integer startLongitude;
    private Integer startLatitude;
    private String endName;
    private Integer endLongitude;
    private Integer endLatitude;
    private String description;

    @Id
    @Column(name = "id", nullable = false)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "order_id", nullable = false)
    public int getOrderId() {
        return orderId;
    }

    public void setOrderId(int orderId) {
        this.orderId = orderId;
    }

    @Basic
    @Column(name = "distance", nullable = false)
    public int getDistance() {
        return distance;
    }

    public void setDistance(int distance) {
        this.distance = distance;
    }

    @Basic
    @Column(name = "order_price_id", nullable = false)
    public int getOrderPriceId() {
        return orderPriceId;
    }

    public void setOrderPriceId(int orderPriceId) {
        this.orderPriceId = orderPriceId;
    }

    @Basic
    @Column(name = "start_name", nullable = true, length = 100)
    public String getStartName() {
        return startName;
    }

    public void setStartName(String startName) {
        this.startName = startName;
    }

    @Basic
    @Column(name = "start_longitude", nullable = true)
    public Integer getStartLongitude() {
        return startLongitude;
    }

    public void setStartLongitude(Integer startLongitude) {
        this.startLongitude = startLongitude;
    }

    @Basic
    @Column(name = "start_latitude", nullable = true)
    public Integer getStartLatitude() {
        return startLatitude;
    }

    public void setStartLatitude(Integer startLatitude) {
        this.startLatitude = startLatitude;
    }

    @Basic
    @Column(name = "end_name", nullable = true, length = 100)
    public String getEndName() {
        return endName;
    }

    public void setEndName(String endName) {
        this.endName = endName;
    }

    @Basic
    @Column(name = "end_longitude", nullable = true)
    public Integer getEndLongitude() {
        return endLongitude;
    }

    public void setEndLongitude(Integer endLongitude) {
        this.endLongitude = endLongitude;
    }

    @Basic
    @Column(name = "end_latitude", nullable = true)
    public Integer getEndLatitude() {
        return endLatitude;
    }

    public void setEndLatitude(Integer endLatitude) {
        this.endLatitude = endLatitude;
    }

    @Basic
    @Column(name = "description", nullable = true, length = 2000)
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TestOrderJourneysEntity that = (TestOrderJourneysEntity) o;

        if (id != that.id) return false;
        if (orderId != that.orderId) return false;
        if (distance != that.distance) return false;
        if (orderPriceId != that.orderPriceId) return false;
        if (startName != null ? !startName.equals(that.startName) : that.startName != null) return false;
        if (startLongitude != null ? !startLongitude.equals(that.startLongitude) : that.startLongitude != null)
            return false;
        if (startLatitude != null ? !startLatitude.equals(that.startLatitude) : that.startLatitude != null)
            return false;
        if (endName != null ? !endName.equals(that.endName) : that.endName != null) return false;
        if (endLongitude != null ? !endLongitude.equals(that.endLongitude) : that.endLongitude != null) return false;
        if (endLatitude != null ? !endLatitude.equals(that.endLatitude) : that.endLatitude != null) return false;
        if (description != null ? !description.equals(that.description) : that.description != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + orderId;
        result = 31 * result + distance;
        result = 31 * result + orderPriceId;
        result = 31 * result + (startName != null ? startName.hashCode() : 0);
        result = 31 * result + (startLongitude != null ? startLongitude.hashCode() : 0);
        result = 31 * result + (startLatitude != null ? startLatitude.hashCode() : 0);
        result = 31 * result + (endName != null ? endName.hashCode() : 0);
        result = 31 * result + (endLongitude != null ? endLongitude.hashCode() : 0);
        result = 31 * result + (endLatitude != null ? endLatitude.hashCode() : 0);
        result = 31 * result + (description != null ? description.hashCode() : 0);
        return result;
    }
}
